<template>
    <div class="classBaseInfoOperate">
      <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm">
        <el-form-item label="班级编号" prop="classId">
          <el-input v-model="ruleForm.classId"></el-input>
        </el-form-item>
        <el-form-item label="班级名称" prop="className">
          <el-input v-model="ruleForm.className"></el-input>
        </el-form-item>
        <el-form-item label="简称" prop="abbr">
          <el-input v-model="ruleForm.name"></el-input>
        </el-form-item>
        <el-form-item label="所属专业" prop="belongProfession">
          <el-select v-model="ruleForm.belongProfession" placeholder="请选择活动区域">
            <el-option label="区域一" value="shanghai"></el-option>
            <el-option label="区域二" value="beijing"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="入学年份" required>
          <el-form-item prop="enrollmentTime">
            <el-date-picker
              v-model="ruleForm.enrollmentTime"
              type="date"
              placeholder="选择日期"
              :picker-options="pickerOptions0">
            </el-date-picker>
          </el-form-item>
        </el-form-item>
        <el-form-item label="培养方案" prop="trainingSchemeId">
          <el-select v-model="ruleForm.trainingSchemeId" placeholder="请选择活动区域">
            <el-option label="区域一" value="shanghai"></el-option>
            <el-option label="区域二" value="beijing"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item>
          <el-button type="primary" @click="submitForm('ruleForm')">立即创建</el-button>
          <el-button @click="resetForm('ruleForm')">重置</el-button>
        </el-form-item>
      </el-form>
    </div>
</template>
<style>
</style>
<script>
    export default{
        name : 'classBaseInfoOperate',
        data(){
            return{
                ruleForm : {
                    classId : '',
                    className : '',
                    abbr : '',
                    belongProfession : '',
                    enrollmentTime : '',
                    trainingSchemeId : ''
                },
                rules : {
                    classId : [
                        { required: true, message: '请输入班级编号', trigger: 'blur' }
                    ],
                    className : [
                        { required: true, message: '请输入班级编号', trigger: 'blur' }
                    ],
                    abbr : [
                        { required: true, message: '请输入班级编号', trigger: 'blur' }
                    ],
                    belongProfession : [
                        { required: true, message: '请输入班级编号', trigger: 'blur' }
                    ],
                    enrollmentTime : [
                        { required: true, message: '请输入班级编号', trigger: 'blur' }
                    ],
                    trainingSchemeId : [
                        { required: true, message: '请输入班级编号', trigger: 'blur' }
                    ]
                }
            }
        },
        components:{
        },
        methods: {
            submitForm(formName) {
                this.$refs[formName].validate((valid) => {
                    if (valid) {
                        alert('submit!');
                    } else {
                        console.log('error submit!!');
                        return false;
                    }
                });
            }
        }
    }
</script>
